<%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec"    uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp"%>
  <%@ include file="/WEB-INF/include/submenu.jsp"%>
  
  <div class="container-fluid ms-container has-ms-sidemenu">
    
    <ol class="ms-breadcrumb breadcrumb">
      <li class="active">客户管理 &nbsp;-&nbsp;客户访谈记录</li>
    </ol>
    
    <div class="ms-content-layout has-operation">

      <div class="ms-operation-bar no-margin no-bottom-border clearfix">
        <div class="ms-operation-group pull-right">
          <a href="${ctx.host}/client-interview-records/add" class="btn ms-btn ms-btn-blue" data-target="#add" data-toggle="modal">
            <i class="glyphicon glyphicon-plus"></i>&nbsp;&nbsp;添加
          </a>
          <a href="${ctx.host}/client-interview-records/export" class="btn ms-btn ms-btn-blue" data-target="#export" data-toggle="modal">
            <i class="glyphicon glyphicon-download-alt"></i>&nbsp;&nbsp;导出
          </a>
        </div>
      </div>

      <table class="table table-hover ms-table">
        <thead>
          <tr>
            <th>序号</th>
            <th>访谈客户</th>
            <th>联系人</th>
            <th>联系电话</th>
            <th style="width: 100px">访谈时间</th>
            <th>访谈地点</th>
            <th style="/*max-width: 200px !important;*/white-space: pre-wrap;word-break: break-word;">内容概要</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>

          <c:forEach items="${clientInterviewRecords}" var="cir" varStatus="status">
          <tr>
            <td>${status.index + 1}</td>
            <td>${cir.client.contacts}</td>
            <td>${cir.client.contacts}</td>
            <td>${cir.client.phone}</td>
            <td style="width: 100px"><fmt:formatDate value="${cir.interviewTime}" pattern="yyyy-MM-dd HH:mm"></fmt:formatDate></td>
            <td>${cir.interviewLocation}</td>
            <td style="max-width: 200px !important; white-space: pre-wrap;word-break: break-word;">${cir.interviewSummary}</td>
            <td>
              <a href="${ctx.host}/client-interview-records/${cir.id}">详情</a>
              <a href="${ctx.host}/client-interview-records/${cir.id}/delete" data-target="#delete" data-toggle="modal">删除</a>
            </td>
          </c:forEach>

          </tr>
        </tbody>
        <tfoot>
          <tr>
            <td colspan="9" class="no-vertical-padding">
              <div class="pull-left">
                <jsp:include page="/WEB-INF/include/page.jsp">
                  <jsp:param name="url" value="${ctx.host}/clients" />
                      <jsp:param name="queryString" value="${queryString}"/>
                </jsp:include>
              </div>
            </td>
          </tr>
        </tfoot>
      </table>
    </div>
  </div> 

  <%@ include file="/WEB-INF/include/footer.jsp"%>
  <%@ include file="/WEB-INF/include/script.jsp"%>
  
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/data/client-interview-record-list" />
  <script type="text/javascript">
      require([ 'page/data/client-interview-record-list' ], function(page) {
          page.init();
      })
  </script>
  
</body>
</html>